package demo.pattern.listener;

public class Test {
	public static void main(String[] args) {
		// 1、创建、注册事件监听器
		SingleClickEventListener singleClickEventListener = new SingleClickEventListener();
		DoubleClickEventListener doubleClickEventListener = new DoubleClickEventListener();
		EventSource.register(singleClickEventListener);
		EventSource.register(doubleClickEventListener);
		// 2、产生事件
		Event event = new Event();
		event.setType("单击");
		// 3、注册中心发布事件
		EventSource.publish(event);
	}
}
